{template '_header'}
<div class="page-heading">
	<span class='pull-right'>
		{ifp 'sns.board.add'}
			<a class="btn btn-primary btn-sm" href="{php echo webUrl('sns/board/add')}">添加新版块</a>
		{/if}
		<a class="btn btn-default  btn-sm" href="{php echo webUrl('sns/board')}">返回列表</a>
	</span>
    <h2>{if !empty($item['id'])}编辑{else}添加{/if}版块 <small>{if !empty($item['id'])}修改【{$item['title']}】{/if}</small></h2>
</div>


<form {ife 'sns.board' $item}action="" method="post"{/if} class="form-horizontal form-validate" enctype="multipart/form-data">
<input type="hidden" name="id" value="{$item['id']}" />


<input type="hidden" id="tab" name="tab" value="#tab_{$_GPC['tab']}" />
<div class="tabs-container>
	 <div class="tabs-left">
<ul class="nav nav-tabs" id="myTab">
    <li  {if empty($_GPC['tab']) || $_GPC['tab']=='basic'}class="active"{/if}><a href="#tab_basic">基本</a></li>
    <li  {if $_GPC['tab']=='credit'}class="active"{/if}><a href="#tab_credit">积分</a></li>
    <li  {if $_GPC['tab']=='share'}class="active"{/if}><a href="#tab_share">关注及分享</a></li>
    <li  {if $_GPC['tab']=='member'}class="active"{/if}><a href="#tab_member">会员权限</a></li>
    {if p('commission')}
    <li  {if $_GPC['tab']=='commission'}class="active"{/if}><a href="#tab_commission">分销商权限</a></li>
    {/if}
    {if p('globonus')}
    <li  {if $_GPC['tab']=='globonus'}class="active"{/if}><a href="#tab_globonus">股东权限</a></li>
    {/if}


</ul>
<div class="tab-content ">
    <div class="tab-pane   {if empty($_GPC['tab']) || $_GPC['tab']=='basic'}active{/if}" id="tab_basic"><div class="panel-body">{template 'sns/board/tab/basic'}</div></div>
    <div class="tab-pane   {if $_GPC['tab']=='credit'}active{/if}" id="tab_credit"><div class="panel-body">{template 'sns/board/tab/credit'}</div></div>
    <div class="tab-pane   {if $_GPC['tab']=='share'}active{/if}" id="tab_share"><div class="panel-body">{template 'sns/board/tab/share'}</div></div>
    <div class="tab-pane   {if $_GPC['tab']=='member'}active{/if}" id="tab_member"><div class="panel-body">{template 'sns/board/tab/member'}</div></div>
    {if p('commission')}
    <div class="tab-pane   {if $_GPC['tab']=='commission'}active{/if}" id="tab_commission"><div class="panel-body">{template 'sns/board/tab/commission'}</div></div>
    {/if}
    {if p('globonus')}
    <div class="tab-pane   {if $_GPC['tab']=='globonus'}active{/if}" id="tab_globonus"><div class="panel-body">{template 'sns/board/tab/globonus'}</div></div>
    {/if}

</div>
</div>
{ife 'sns.board' $item}
<div class="form-group">
    <label class="col-sm-2 control-label"></label>
    <div class="col-sm-9 col-xs-12">
        <input type="submit"  value="提交" class="btn btn-primary" />
    </div>
</div>
{/if}

</form>

<script language='javascript'>
    require(['bootstrap'], function () {
        $('#myTab a').click(function (e) {
            $('#tab').val($(this).attr('href'));
            e.preventDefault();
            $(this).tab('show');
        })
    });
</script>
{template '_footer'}